package com.cong.project.model.enums;

/**
 * 内容类型
 *
 * @author 聪
 */
public enum ContentTypeEnum {
    /**
     * 内容类型
     */
    POST(1, "帖子"),

    COMMENT(2, "评论"),

    PRODUCT(3, "商品");

    private final int code;

    /**
     * 状态码信息
     */
    private final String message;



    ContentTypeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }
    public static ContentTypeEnum geEnumByValue(Integer code){
        if (code==null){
            return null;
        }
        ContentTypeEnum[] values = ContentTypeEnum.values();
        for (ContentTypeEnum teamStatusEnum : values) {
            if (teamStatusEnum.getCode() ==code){
                return teamStatusEnum;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
